home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.plaf.basic;
-
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.InputEvent;
- import java.awt.event.KeyAdapter;
- import java.awt.event.KeyEvent;
- import javax.swing.Action;
- import javax.swing.KeyStroke;
-
- public class BasicTreeUI$KeyHandler extends KeyAdapter {
- // $FF: synthetic field
- private final BasicTreeUI this$0;
- protected Action repeatKeyAction;
- protected boolean isKeyDown;
-
- public BasicTreeUI$KeyHandler(BasicTreeUI var1) {
- this.this$0 = var1;
- }
-
- public void keyPressed(KeyEvent var1) {
- if (this.this$0.tree.hasFocus() && this.this$0.tree.isEnabled()) {
- KeyStroke var2 = KeyStroke.getKeyStroke(var1.getKeyCode(), ((InputEvent)var1).getModifiers());
- if (this.this$0.tree.getConditionForKeyStroke(var2) == 0) {
- ActionListener var3 = this.this$0.tree.getActionForKeyStroke(var2);
- if (var3 instanceof Action) {
- this.repeatKeyAction = (Action)var3;
- } else {
- this.repeatKeyAction = null;
- }
- } else {
- this.repeatKeyAction = null;
- }
-
- if (this.isKeyDown && this.repeatKeyAction != null) {
- this.repeatKeyAction.actionPerformed((ActionEvent)null);
- ((InputEvent)var1).consume();
- } else {
- this.isKeyDown = true;
- }
- }
-
- }
-
- public void keyReleased(KeyEvent var1) {
- this.isKeyDown = false;
- }
- }
-